﻿using UnityEngine;
using System.Collections.Generic;
using Dict.DataModel;

namespace Dict.Blo
{
    public class TableEquipOutfitBlo
    {
        public static List<TableEquipOutfit> GetOutfitsById(string outfitId)
        {
            return Dict.DictDataManager.Instance.tableEquipOutfitDao.GetByOneIndex(outfitId);
        }

        public static List<TableEquipOutfit> GetOutfitAttribute(string outfitId,int number)
        {
            var list = Dict.DictDataManager.Instance.tableEquipOutfitDao.GetByOneIndex(outfitId);
            List<TableEquipOutfit> res = new List<TableEquipOutfit>();
            for(int i = 0; i < list.Count;++i)
            {
                if(list[i].num <= number)
                {
                    res.Add(list[i]);
                }
            }
            return res;
        }

        public static TableEquipOutfit GetOneOutfit(string outfitId, int number)
        {
            var list = Dict.DictDataManager.Instance.tableEquipOutfitDao.GetByOneIndex(outfitId);
            for (int i = 0; i < list.Count; ++i)
            {
                if (list[i].num == number)
                {
                    return list[i];
                }
            }
            return null;
        }
    }
}